<?php
/*
 * This is for showing fit mama data
 */
include '../../include/config.php';
$fit = mysql_query("select * from baby_mother_fit where bid='" . $_COOKIE['bid'] . "' ");
$a = mysql_num_rows($fit);
if ($a == 0) {
    $avail = false;
} else {
    $avail = true;
}
?>

<fieldset>
    <legend>My Fit Activity</legend>
    <?php if ($avail == false) { ?>
        You have not inserted your Fitness Activity :<br>
        <form action="../wm/add.php" method="post" >

            <table>
                <tr>
                    <td>Sport Activity :</td>
                    <td>
                        <select name="activity" >
                            <option value="Walking" >Walking</option>
                            <option value="Runing">Running</option>
                            <option value="Tennis">Tennis</option>
                            <option value="Swimming">Swimming</option>
                            <option value="Aerobic">Aerobic</option>
                            <option value="Cycling">Cycling</option>
                            <option value="Pilates">Pilates</option>
                            <option value="Yoga">Yoga</option>
                            <option value="Other">Other</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>I make sport activity :</td>
                    <td>
                        <select name="time">
                            <option value="Every Day" >Every Day</option>
                            <option value="Twice a week">Twice a week</option>
                            <option value="Once in a month">Once in a month</option>
                            <option value="None">None</option>
                        </select>
                    </td>
                </tr>                         
                <tr>
                    <td>
                        <input type="submit" value="Enter Info" style="float: right;" />
                    </td>
                    <td></td>
                </tr>

            </table>
        </form>  
    <?php } ?>


    <?php if ($avail == true) { ?>

        <?php if ($_GET['p'] == 'view' || $_GET['p'] == '') { ?>
            <a href="Woman-Mother?menu=fit&p=edit" >UPDATE</a>
            <?php while ($row1 = mysql_fetch_array($fit)) { ?>                
                <table style="padding-left: 150px;" >
                    <tr>
                        <td style="width: 150px;" >Sport Activity:</td>
                        <td style="width: 200px;"><?= $row1[2] ?> </td>
                    </tr>
                    <tr>
                        <td>I make sport activity : </td>
                        <td><?= $row1[3] ?></td>
                    </tr>
                </table>

            <?php }
            ?>  
        <?php } elseif ($_GET['p'] == 'edit') {
            ?>


            <?php while ($row1 = mysql_fetch_array($fit)) { ?>
                <a href="Woman-Mother?menu=fit" >CANCLE</a>
                <form action="../wm/edit.php" method="post" >
                    <table style="padding-left: 150px;" >
                        
                            <tr>
                                <td style="width: 150px;" >Sport Activity:</td>
                                <td style="width: 200px;"><?= $row1[2] ?> <br/>
                                    <select name="activity" >
                                        <option value="Walking" >Walking</option>
                                        <option value="Runing">Running</option>
                                        <option value="Tennis">Tennis</option>
                                        <option value="Swimming">Swimming</option>
                                        <option value="Aerobic">Aerobic</option>
                                        <option value="Cycling">Cycling</option>
                                        <option value="Pilates">Pilates</option>
                                        <option value="Yoga">Yoga</option>
                                        <option value="Other">Other</option>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <td>I make sport activity : </td>
                                <td><?= $row1[3] ?><br/>
                                    <select name="time">
                                        <option value="Every Day" >Every Day</option>
                                        <option value="Twice a week">Twice a week</option>
                                        <option value="Once in a month">Once in a month</option>
                                        <option value="None">None</option>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                    <td>
                        <input type="submit" value="Update Info" style="float: right;" />
                    </td>
                    <td></td>
                </tr>
                    </table>

                </form>  
                <?php
            }
        }
        ?>      
    <?php } ?>    

</fieldset>